/**
 * gulp配置文件
 */

const gulp = require("gulp");
const buffer = require('vinyl-buffer');
const source = require('vinyl-source-stream');
const uglify = require('gulp-uglify');
const rename = require('gulp-rename');
const browserify = require('browserify');


gulp.task('dist', function () {
    return browserify('./javascripts/index.js')
        .bundle()
        .pipe(source('./javascripts/freedoocx.js'))
        .pipe(buffer())
        //.pipe(uglify()) // uglify 
        .pipe(rename("index.min.js"))
        .pipe(gulp.dest('./javascripts'));
});
